package com.example.androidstudy.ch06;

import com.example.androidstudy.R;

import android.app.Activity;
import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.Color;
import android.os.Bundle;
import android.text.Layout;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup.LayoutParams;
import android.widget.LinearLayout;
import android.widget.TextView;

public class InflationEx extends Activity {
	 @Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
	/*	LinearLayout layout = new LinearLayout(this);
		layout.setOrientation(LinearLayout.VERTICAL);
		layout.setBackgroundColor(Color.LTGRAY);
		
		TextView tv = new TextView(this);
		tv.setText("TextView");
		tv.setGravity(Gravity.CENTER);
		tv.setTextColor(Color.RED);
		tv.setTextSize(20);
		
		layout.addView(tv);
		setContentView(layout);*/
		
		/*LayoutInflater inflator = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		LinearLayout layout=(LinearLayout) inflator.inflate(R.layout.inflation, null);
		
		setContentView(layout);*/
	 
		/*LayoutInflater inflator=LayoutInflater.from(this);
		LinearLayout layout=(LinearLayout) inflator.inflate(R.layout.inflation, null);
		
		setContentView(layout);*/
		
		LinearLayout inflater =(LinearLayout) View.inflate(this, R.layout.inflation, null);
		
		setContentView(inflater);
	 }
}
